<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>增加新行</title>
</head>
    <script src="vue.js"></script>
    <body>
        <div id="test1">
            <p>{{message}}</p>
            <p v-for="(item, index) in list">{{item}}</p>
            <span v-for="(item, index) in num"><button>新按钮</button></span>
            <hr>
            <button @click.once="add">点击加一行</button>
            <button @click="num++">点击加一个按钮</button>
        </div>
    </body>
    <script>
    
        var vm = new Vue({
            el: '#test1',
            data: {
    
                list: [],
                message: '哈哈',
                num:0
    
            },
            methods: {
                add(value) {
                    this.list.push('哈哈这是新一行')
                }
            },
        });
    </script>
    
</html>